<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="/jquery/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script type="text/javascript" src="/layui/layui.js"></script>
    <title>受理用户反馈信息</title>
    <style>
        #buttonA{
            width: 200px;
            height: 300px;
            margin: 0 auto;
        }
    </style>
</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">用户账号</label>
        <div class="layui-input-inline">
            <input type="text" name="userAccount" required  style="margin-top: 20px" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">反馈类型</label>
        <div class="layui-input-inline">
            <input type="text" name="FeedbackType" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">意见类型</label>
        <div class="layui-input-inline">
            <input type="text" name="OpinionType" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">反馈时间</label>
        <div class="layui-input-inline">
            <input type="text" name="FeedbackTime" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">反馈内容</label>
        <div class="layui-input-block">
            <textarea type="text" name="FeedbackContent" required lay-verify="required" placeholder="" style="width: 400px" class="layui-textarea"></textarea>
        </div>
    </div>
    <div id="buttonA">
        <button type="button" onclick="Accepted()" class="layui-btn layui-btn-normal">受理</button>
        <button type="button" onclick="quXiao()" class="layui-btn layui-btn-primary">取消</button>
    </div>
</form>
</body>
    <script>
        var form;
        var $;
        var table;
        var layer;
        layui.use(['form','jquery','table','layer'],function() {
            form = layui.form;
            $ = layui.$;
            table = layui.table;
            layer = layui.layer;

            var fanKui =JSON.parse(localStorage.getItem("fanKui"));

            if(fanKui.feedbackType == 2){
                fanKui.feedbackType = "视频反馈";
            }else if(fanKui.feedbackType == 3){
                fanKui.feedbackType == "商品反馈";
            }else if(fanKui.feedbackType == 4){
                fanKui.feedbackType == "其他反馈";
            }

            if(fanKui.feedbackClassification == 2){
                fanKui.feedbackClassification = "很好";
            }else if(fanKui.feedbackClassification ==3){
                fanKui.feedbackClassification = "好";
            }else if(fanKui.feedbackClassification == 4){
                fanKui.feedbackClassification = "一般";
            }else if(fanKui.feedbackClassification == 5){
                fanKui.feedbackClassification = "差";
            }
            $("input[name = userAccount]").val(fanKui.userId);
            $("input[name = FeedbackType]").val(fanKui.feedbackType);
            $("input[name = OpinionType]").val(fanKui.feedbackClassification);
            $("input[name = FeedbackTime]").val(fanKui.createDate);
            $("textarea[name = FeedbackContent]").val(fanKui.feedbackContent);

            //受理
            Accepted = function Accepted(){
                feedbackId = fanKui.feedbackId;
                layer.open({
                    type: 1,
                    title: "信息",
                    content:"<div style='font-size: 15px ; margin:30px  ;'>您确定要受理此意见吗?</div>",
                    area: ['300px', '200px'],
                    btn: ['确定', '取消1'],
                    yes: function (index, layero) {
                        $.ajax({
                            url:'/UserFeedback/updateAccepted',
                            data:{"feedbackId": feedbackId},
                            success:function (data) {
                                if(data){
                                    layer.msg("审核成功");
                                }else{
                                    layer.msg("审核失败");
                                }
                                layer.close(index);
                            }
                        });
                    },
                    btn2: function (index, layero) {
                        layer.close(index);
                    }
                });
            }
            //取消
            quXiao = function  quXiao() {
                var layer = parent.layer;
                layer.close(layer.index);
            }
        });

    </script>
</html>